package gongju;

import DemoInterceptor.CeInterceptor;
import com.jfinal.aop.Before;
import com.jfinal.core.Controller;
import com.jfinal.json.FastJson;
import com.jfinal.render.Render;
import sun.nio.ch.FileKey;

import javax.servlet.SessionCookieConfig;
import javax.servlet.http.HttpSession;

public class Ts extends Controller {
    @Before(CeInterceptor.class)
    public void a() {
        System.out.println("我要起飞了");
        setAttr("na", "wng");
        redirect("http://localhost:88/c1.html");
//        render("c1.html");

    }


    public void sk() {
        String age = getPara("age");
        HttpSession session = getSession();
        session.setAttribute("age", age);
        session.setAttribute("age2", age);
        renderJson(age);

    }

    public void sk2() {
        HttpSession session = getSession();
        Object age = session.getAttribute("age");
        renderJson(session.getAttributeNames());
    }

}
